import deepcopy from 'deepcopy'
export const baseValidate = {
  name: [{
    required: true,
    message: '部门名称不能为空',
    trigger: 'blur'
  },
  {
    type: 'string',
    min: 2,
    max: 20,
    message: '部门名长度必须是2~20字符',
    trigger: 'blur'
  }],
  sort: [
    {
      max: 100,
      min: 0,
      message: '排序只能0~100的整数'
    }

  ],
  liaison: [
    {
      type: 'string',
      max: 20,
      message: '部门负责人长度不能大于20个字符',
      trigger: 'blur'
    }],
  status: [
    {
      required: true,
      message: '部门状态不能为空',
      trigger: 'blur'
    },
    {
      type: 'enum',
      enum: ['NORMAL', 'STOP_USING'],
      message: '选择部门状态',
      trigger: 'blur'
    }
  ],
  phone: [
    {
      max: 15,
      message: '电话不能大于15个字符',
      trigger: 'blur'
    }
  ],
  email: [
    {
      max: 20,
      message: '邮箱不能大于20个字符',
      trigger: 'blur'
    }
  ]
}

export const addValidate = deepcopy(baseValidate)

export const editValidate = deepcopy(baseValidate)
